<!DOCTYPE html>
<html lang="en">
<head>
<meta name="layout" content="main_pc">
<title>火堆工作台</title>
<link rel="stylesheet"
	href="${resource(dir: 'css', file: 'user.center.css')}" type="text/css">
<script
	src="${resource(dir: 'js', file: 'bootstrap-datepicker.min.js')}"
	charset="UTF-8"></script>
<link rel="stylesheet"
	href="${resource(dir: 'css_pc', file: 'bootstrap-datepicker.css')}"
	type="text/css">
<style>
#menu {
	width: 700px;
	overflow: hidden;
	margin: 10px auto;
	border: 1px solid #BF9660;
}

#menu #nav {
	display: block;
	width: 100%;
	padding: 0;
	margin: 0;
	list-style: none;
}

#menu #nav li {
	float: left;
	width: 139px;
}

#menu #nav li a {
	display: block;
	line-height: 37px;
	text-decoration: none;
	padding: 0 0 0 5px;
	text-align: center;
	color: #333;
}

.tag {
	padding: 30px;
	overflow: hidden;
}

.selected {
	background: #C5A069;
	color: #fff;
}
</style>
</head>
<body>

	<div class="container-fluid">

		<section class="quick-navi mb20">
			<div class="container">
				<a href="#" class="quick-link"><span>火堆工作台</span><span
					class="caret"></span></a>
				<!--a href="#" class="quick-link">联系我们</a-->
			</div>
		</section>

		<section>
			<div class="container mb50">

				<g:render template="navigate" model="[status: status]" />


				<div class="right-content" id="rightconsole">
					<div
						style="line-height: 25px; font-size: 18pt; padding: 10px 0px 10px 0px">
						审核</div>

				</div>

				<div id="menu">
					<!--tag标题-->
					<ul id="nav">
						<g:if test="${project.verified=='expired' || project.verified=='execute'|| project.verified=='doing'}">
						<li><a href="#" name="li" class="selected" >款项支付</a></li>
						</g:if>
						<g:if test="${project.verified=='doing'}">
						<li><a href="#" name="li" class="">结项审核</a></li>
						</g:if>

						<li><a href="#" name="li" class="">延期</a></li>
					</ul>
					<!--二级菜单-->
					<div id="menu_con">
					<g:if test="${project.verified=='expired' || project.verified=='execute'|| project.verified=='doing'}">
						<g:form action='projectPayoffApprove' method="post"
							class="form-style3">
							<input type="hidden" name="projectid" value="${project.id}">
							<div class="tag" name="tag" style="display:block;margin-top:50px;">

								<div class="form-item fix-width">
									<label for="">打款时间：<span class="tips"></span></label> <input
										type="text" name="payoffDate" class="datePicker"
										id="datePicker1" value="" size="50" />
								</div>
								<div class="form-item fix-width">
									<label for="">支付金额：<span class="tips"></span></label> <input
										type="text" name="money" value='' size="50" placeholder="请输入数字，最多2位小数" onblur="checkFloatNum(this, 0.0);"/>
								</div>
								<div class="form-item fix-width">
									<label for="">OA订单号：<span class="tips"></span></label> <input
										type="text" name="OA" value='' size="50" />
								</div>
								<div class="form-item fix-width">
									<label for="">备注：<span class="tips"></span></label>
									<textarea name="mark" id="t2" rows="10" cols="50"></textarea>
								</div>
								<div class="form-item fix-width">
									<Button class="btn btn-download-all" data-dialog="dialog1">提交</Button>
									<Button class="btn btn-download-all" data-dialog="dialog1"
										style='margin-left: 50px'>取消</Button>
								</div>
								<div>
									<h4>审核历史</h4>
									<g:each in="${foperates }" var="foperate">
										<g:if test="${foperate.operate=='contentApprove'}">
											<div class="form-item fix-width">
												内容审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												理由：
												${foperate.excuse }
											</div>
										</g:if>
										<g:elseif test="${foperate.operate=='payoff'}">
											<div class="form-item fix-width">
												款项支付：
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												打款时间：
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.payoffDate }" />
											</div>
											<div class="form-item fix-width">
												支付金额：
												${foperate.money }
											</div>
											<div class="form-item fix-width">
												备注：
												${foperate.mark }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='refund'}">
											<div class="form-item fix-width">
												款项退款
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												退款理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='over'}">
											<div class="form-item fix-width">
												结项审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												结项理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='active'}">
											<div class="form-item fix-width">
												项目延期
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												激活天数：
												${foperate.duration }
											</div>
										</g:elseif>
									</g:each>
								</div>
							</div>
						</g:form>
						</g:if>
						<g:if test="${ project.verified=='doing'}">
						<g:form action='projectOverApprove' method="post"
							class="form-style3">
							<input type="hidden" name="projectid" value="${project.id}">
							<div class="tag" name="tag" style="display: none;margin-top:50px;">
								
								<input type="radio" name="check" value="pass" /> 通过 <input
									type="radio" name="check" value="refuse"
									style='margin-left: 100px' /> 驳回
								<div class="form-item fix-width">
									<textarea name="excuse" class="t" id="t1" rows="10" cols="50">理由</textarea>
								</div>
								<div class="form-item fix-width">
									<Button class="btn btn-download-all" data-dialog="dialog1">提交</Button>
									<Button class="btn btn-download-all" data-dialog="dialog1"
										style='margin-left: 50px'>取消</Button>
								</div>
								<div>
									发送消息给发起方<input type="checkbox" name="flag" value="pass" /><p>结项内容  备注：理由将直接发送给发起方</p>
								</div>
								<div>
									<h4>审核历史</h4>
									<g:each in="${foperates }" var="foperate">
										<g:if test="${foperate.operate=='contentApprove'}">
											<div class="form-item fix-width">
												内容审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												理由：
												${foperate.excuse }
											</div>
										</g:if>
										<g:elseif test="${foperate.operate=='payoff'}">
											<div class="form-item fix-width">
												款项支付：
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												打款时间：
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.payoffDate }" />
											</div>
											<div class="form-item fix-width">
												支付金额：
												${foperate.money }
											</div>
											<div class="form-item fix-width">
												备注：
												${foperate.mark }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='refund'}">
											<div class="form-item fix-width">
												款项退款
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												退款理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='over'}">
											<div class="form-item fix-width">
												结项审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												结项理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='active'}">
											<div class="form-item fix-width">
												项目延期
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												激活天数：
												${foperate.duration }
											</div>
										</g:elseif>
									</g:each>
								</div>
							</div>
						</g:form>
						</g:if>
						<g:form action='projectActive' method="post"
							class="form-style3">
							<input type="hidden" name="projectid" value="${project.id}">
							<div class="tag" name="tag" style="display: none;margin-top:50px;">
								<div class="form-item fix-width">
									<textarea name="duration" class="t" id="t2" rows="1" cols="50">激活天数（1-99天）</textarea>
								</div>
								<div class="form-item fix-width">
									<Button class="btn btn-download-all" data-dialog="dialog1">提交</Button>
									<Button class="btn btn-download-all" data-dialog="dialog1"
										style='margin-left: 50px'>取消</Button>
								</div>
								<div>
									<h4>审核历史</h4>
									<g:each in="${foperates }" var="foperate">
										<g:if test="${foperate.operate=='contentApprove'}">
											<div class="form-item fix-width">
												内容审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												理由：
												${foperate.excuse }
											</div>
										</g:if>
										<g:elseif test="${foperate.operate=='payoff'}">
											<div class="form-item fix-width">
												款项支付：
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												打款时间：
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.payoffDate }" />
											</div>
											<div class="form-item fix-width">
												支付金额：
												${foperate.money }
											</div>
											<div class="form-item fix-width">
												备注：
												${foperate.mark }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='refund'}">
											<div class="form-item fix-width">
												款项退款
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												退款理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='over'}">
											<div class="form-item fix-width">
												结项审核
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<g:if test="${foperate.result=='pass'}">
												<div class="form-item fix-width">审核结果：通过</div>
											</g:if>
											<g:elseif test="${foperate.result=='refuse'}">
												<div class="form-item fix-width">审核结果： 驳回</div>
											</g:elseif>
											<div class="form-item fix-width">
												结项理由：
												${foperate.excuse }
											</div>
										</g:elseif>
										<g:elseif test="${foperate.operate=='active'}">
											<div class="form-item fix-width">
												项目延期
												${user.username}
												<g:formatDate format="yyyy-MM-dd HH:mm"
													date="${foperate.optDate }" />
											</div>
											<div class="form-item fix-width">
												激活天数：
												${foperate.duration }
											</div>
										</g:elseif>
									</g:each>
								</div>
							</div>
						</g:form>
					</div>

				</div>




			</div>
			<div class="clearboth"></div>
		</section>


	</div>

	<!-- 删除弹出框 -->


	<script type="text/javascript">
		$(function() {
			$(
					'.meterial-lib-box .content-box .form-box .img-box input[type=file]')
					.change(
							function() {
								$(this)
										.siblings('.img-default')
										.hide()
										.parent()
										.css('background-image',
												'url(' + getFileURL(this) + ')');
							});
		});
	</script>

	<script>
		var ts = document.getElementsByClassName('t');
		for (var i = 0; i < ts.length; i++) {
			ts[i].onfocus = function() {
				if (this.innerHTML != '') {
					this.value = ''
				}
			};

			ts[i].onblur = function() {
				if (this.value == '') {
					this.innerHTML = ''
				}
			};

		}

		var tabs = function() {
			function tag(name, elem) {
				return document.getElementsByName(name);
			}
			//获得相应ID的元素
			function id(name) {
				return document.getElementById(name);
			}
			return {
				set : function(elemId, tabId) {
					var elem = tag("li", id(elemId));
					var tabs = tag("tag", id(tabId));
					var listNum = elem.length;
					var tabNum = tabs.length;
					for (var i = 0; i < listNum; i++) {
						elem[i].onclick = (function(i) {
							return function() {
								for (var j = 0; j < tabNum; j++) {
									if (i == j) {
										tabs[j].style.display = "block";
										// alert(elem[j].firstChild);
										elem[j].className = "selected";
									} else {
										tabs[j].style.display = "none";
										elem[j].className = "";
									}
								}
							}
						})(i)
					}
				}
			}
		}();
		tabs.set("nav", "menu_con");//执行
	</script>


	<script type="text/javascript">
		$(function() {

			$('.date-picker').datepicker({
				language : 'zh-CN',
				autoclose : true,
				todayHighlight : true
			})

			$('#datePicker1').datepicker({
				format : "yyyy-mm-dd"
			});


			function checkFloatNum(element, init){
		    	var num = element.value 
		    	if(!(/^\d+(\.\d{1,2})?$/.test(num))){
		    		alert("输入正确的价格，最多允许两位小数！");
		            element.value = init;
		    	}
		    }

		});
	</script>

	<!--代码部分end-->

</body>
</html>